﻿
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>炽热教育</title>


<!--必要样式-->
    <link href="css/download_task_css1.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="css/download_task_css1.css" />
<link rel="stylesheet" href="css/download_task_css2.css"/>

<!--可无视-->
<link rel="stylesheet" type="text/css" href="css/download_task_css3.css">

<style type="text/css">
	.post-slide{
		margin: 0 15px;
	}
	.post-slide .post-img{
		overflow: hidden;
	}
	.post-slide .post-img img{
		width: 100%;
		height: auto;
		transform: scale(1);
		transition: all 1s ease-in-out 0s;
	}
	.post-slide:hover .post-img img{
		transform: scale(1.08);
	}
	.post-slide .post-content{
		background: #fff;
		padding: 20px;
	}
	.post-slide .post-title{
		font-size: 17px;
		font-weight: 600;
		margin-top: 0;
		text-transform: capitalize;
	}
	.post-slide .post-title a{
		display: inline-block;
		color: #808080;
		transition: all 0.3s ease 0s;
	}
	.post-slide .post-title a:hover{
		color: #3d3030;
		text-decoration: none;
	}
	.post-slide .post-description{
		font-size: 15px;
		color: #676767;
		line-height: 24px;
		margin-bottom: 14px;
	}
	.post-slide .post-bar{
		padding: 0;
		margin-bottom: 15px;
		list-style: none;
	}
	.post-slide .post-bar li{
		color: #676767;
		padding: 2px 0;
	}
	.post-slide .post-bar li i{
		margin-right: 5px;
	}
	.post-slide .post-bar li a{
		display: inline-block;
		font-size: 12px;
		color: #808080;
		transition: all 0.3s ease 0s;
	}
	.post-slide .post-bar li a:after{
		content: ",";
	}
	.post-slide .post-bar li a:last-child:after{
		content: "";
	}
	.post-slide .post-bar li a:hover{
		color: #3d3030;
		text-decoration: none;
	}
	.post-slide .read-more{
		display: inline-block;
		padding: 10px 15px;
		font-size: 14px;
		font-weight: bold;
		color: #fff;
		background: #e7989a;
		border-bottom-right-radius: 10px;
		text-transform: capitalize;
		transition: all 0.30s linear;
	}
	.post-slide .read-more:hover{
		background: #333;
		text-decoration: none;
	}
</style>

</head>
<body onload ="getWechatInfo()">
<div class="demo">
	<div class="container">
		<div class="row">
			<div class="col-md-12" style="padding: 1em 0;">
				<div id="news-slider" class="owl-carousel">
 
				</div>
			</div>
		</div>
	</div>
</div>

<script src="css/download_task_js1.js" type="text/javascript"></script>
<script type="text/javascript" src="css/download_task_js2.js"></script>
<script type="text/javascript">

    function reoloadItems( items) {
        $("#news-slider").owlCarousel({
            items:3,
            itemsDesktop: [1199, 2],
            itemsDesktopSmall: [980, 2],
            itemsMobile: [600, 1],
            pagination: false,
            navigationText: false,
            autoPlay: true
        });
    }


    /*获取下载列表*/
    function getDownLoadListManager() {
        $.ajax({
            url: '../../ChireInter/Download/DownLoad_List.ashx',
            data: { name: "sma" },
            type: 'post',
            dataType: 'json',
            success: function (res) {

                if (res.errCode == 200) {
                    var html = "";
                    if (res.data.list.length > 0) {
                        for (var i in res.data.list) {
                            var nUrl = "https://chire.oss-cn-hangzhou.aliyuncs.com/" + res.data.list[i].url;
                            var ablum = "https://chire.oss-cn-hangzhou.aliyuncs.com/" + res.data.list[i].ablum + "?x-oss-process=style/download_task";
                            html += "<div class=\"post-slide\">";
                            html += "<div class=\"post-img\">";
                            html += "		<a href=\"#\"><img src=" + "\"" + ablum + "\"" + "alt=\"\"></a>";
                            html += "</div>";
                            html += "<div class=\"post-content\">";
                            html += "	<h3 class=\"post-title\"><a href=\"#\">" + res.data.list[i].name + "</a></h3>";
                            html += "<p class=\"post-description\">" + res.data.list[i].info + "</p>";
                            html += "<ul class=\"post-bar\">"
                            html += "<li><i class=\"fa fa-calendar\"></i> " + res.data.list[i].datetime + "</li>";
                            html += "<li>";
                            html += "<i class=\"fa fa-folder\"></i><a href=\"#\">フ イツビン</a>";
                            html += "</li>";
                            html += "</ul>";


                            html += "<a href=" + "\"" + nUrl + "\"" + " class=\"read-more\" download=\"w3logo\">下载</a>";
                            html += "</div></div>";
                        }

                        var oContent = $('#news-slider')
                        oContent.prepend(html);
                        reoloadItems(res.data.list.count);
                    } else {
                        var searchUrl = encodeURI("../404/404.html?error=当前还没有设置学习资料");
                        window.location.href = searchUrl;
                    }
                    

                } else {
                    alert('提交失败');
                }
            },
            error: function (err) {
                alert('提交失败' + err);
            }
        })
    }

    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);//search,查询？后面的参数，并匹配正则
        if (r != null) return unescape(r[2]); return null;
    }

    /*获取是否有权限*/
    function getAuthManager() {
        // 1. 获取code
        var info = GetQueryString("code");
       
        $.ajax({
            url: '../../ChireInter/Identity/Identity_HasAuthMember.ashx',
            data: { code: info },
            type: 'post',
            dataType: 'json',
            success: function (res) {
              
                if (res.errCode == 200) {
                   
                    if (res.data.hasMember == 1) {
                  
                        getDownLoadListManager();
                    } else if (res.data.hasMember == 0) {
                     
                        window.location.href = "../404/404.html";
                    }
                } else {
                   
                }
            },
            error: function (err) {
                alert('提交失败' + err);
            }
        })
    }

    // 获取微信信息
    function getWechatInfo() {
        var code = GetQueryString('code');

        var args = $.param({
            "code": code
        })
        $.ajax({
            url: '../../ChireInter/Wechat/wechat_auth.ashx',
            data: args,
            type: 'post',
            dataType: 'json',
            success: function (res) {
                if (res.errCode == 200) {
                    getAuthManager();
                } else {

                }
            },
            error: function (err) {

            }
        })

    }
</script>

</body>
</html>